package itheima.zuoye.test4;

import java.util.Scanner;

//键盘录入字符串，判断字符串是否是对称字符串,用StringBuilder常用方法判断，不对称进行反转
public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入字符串：");
        String str = sc.next();
        StringBuilder sb = new StringBuilder(str);
        sb.reverse();


        if (str.equals(sb.toString())){
            System.out.println("对称字符串");
        } else {
            System.out.println("不对称字符串");
            System.out.println("字符串反转为：" + sb.toString());
        }





    }


}
